#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 1010;
int arr[N];
int n;
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	sort(arr, arr + n);
	for (int i = n - 1; i >= 0; i--) {
		int d = sqrt(arr[i]);
		if (d * d != arr[i]) {
			cout << arr[i] << endl;
			break;
		}
	}
	return 0;
}